<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BabyOS: b_sda.c Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="2.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">BabyOS
   &#160;<span id="projectnumber">V1.1.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','Search');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_b9223522bb56aee4ab59f7ba381d2163.html">bos</a></li><li class="navelem"><a class="el" href="dir_f2a2cc749b6bfcea90db6730434b0bd6.html">core</a></li><li class="navelem"><a class="el" href="dir_7991448cbe81caff9afaadef11b942e8.html">src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">b_sda.c</div>  </div>
</div><!--header-->
<div class="contents">
<a href="b__sda_8c.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="comment">/*Includes ----------------------------------------------*/</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="b__sda_8h.html">b_sda.h</a>&quot;</span></div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor">#if (_SAVE_DATA_ENABLE &amp;&amp; _SAVE_DATA_A_ENABLE)</span></div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="b__utc_8h.html">b_utc.h</a>&quot;</span></div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="b__core_8h.html">b_core.h</a>&quot;</span></div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="b__device_8h.html">b_device.h</a>&quot;</span></div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="preprocessor">#include &lt;string.h&gt;</span></div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;<span class="keyword">static</span> <a class="code" href="structb_s_d_a___info__t.html">bSDA_Info_t</a> bSDA_InfoTable[<a class="code" href="b__config_8h.html#a1c60d01d34d0e5f6d11ab663dfcb7801">_SAVE_DATA_A_I_NUMBER</a>];</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;<span class="keyword">static</span> uint8_t bSDA_InfoIndex = 0;</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;<span class="keyword">static</span> <span class="keyword">const</span> uint8_t uNumbers[6] = {60, 60, 24, 31, 12, 0xff};</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;<span class="keyword">static</span> <span class="keywordtype">int</span> _bSDA_CheckInfo(<a class="code" href="structb_s_d_a___info__t.html">bSDA_Info_t</a> *pinfo)</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;{</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;    <span class="keywordflow">if</span>(pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#a904bfc784ec019bfdea0236c862aea9b">base_address</a> &gt;= pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#a80d68ca9cbeea24d62a23d9e35a67c22">data_address</a>)</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    {</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;        <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;    }</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;}</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;<span class="keyword">static</span> <span class="keywordtype">int</span> _bSDA_GetTimeValue(uint8_t unit, uint32_t utc)</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;{</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;    <a class="code" href="structb_u_t_c___date_time__t.html">bUTC_DateTime_t</a> tm;</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;    <span class="keywordtype">int</span> retval = -1;</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;    <span class="keywordflow">if</span>(!<a class="code" href="group___s_d_a___exported___macros.html#ga3e1042c585d3b9145f6b7e4c59797e5a">IS_UNIT_VALID</a>(unit))</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;    {</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;        <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;    }</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;    </div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;    <a class="code" href="group___u_t_c___exported___functions.html#ga51d84ed7d31f7df2d06f75ad8b296dd9">bUTC2Struct</a>( &amp;tm, utc);</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;    </div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;    <span class="keywordflow">switch</span>(unit)</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;    {</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;        <span class="keywordflow">case</span> <a class="code" href="group___s_d_a___exported___defines.html#ga05055f3cee948d8763312327597b6213">UNIT_SECOND</a>:</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;            retval = tm.<a class="code" href="structb_u_t_c___date_time__t.html#a8459fc4e94de7eefc74991e41779c8fc">second</a>;</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;            <span class="keywordflow">break</span>;</div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;        <span class="keywordflow">case</span> <a class="code" href="group___s_d_a___exported___defines.html#ga1b18e73a9b9253beff7c7b7a5460748a">UNIT_MINUTE</a>:</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;            retval = tm.<a class="code" href="structb_u_t_c___date_time__t.html#a8ff981ec55c945940f4a0da7d8709b3c">minute</a>;</div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;            <span class="keywordflow">break</span>;</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;        <span class="keywordflow">case</span> <a class="code" href="group___s_d_a___exported___defines.html#gaddaea55490fd45135a79081c00a90540">UNIT_HOUR</a>:</div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;            retval = tm.<a class="code" href="structb_u_t_c___date_time__t.html#ae5af4ff48939d13d480f87e56a9385d6">hour</a>;</div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;            <span class="keywordflow">break</span>;</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;        <span class="keywordflow">case</span> <a class="code" href="group___s_d_a___exported___defines.html#ga34ef9d077cc547e8924ee1757f6af738">UNIT_DAY</a>:</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;            retval = tm.<a class="code" href="structb_u_t_c___date_time__t.html#a72369a1087b2aeffe374bb054cb97c12">day</a> - 1;</div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;            <span class="keywordflow">break</span>;</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;        <span class="keywordflow">case</span> <a class="code" href="group___s_d_a___exported___defines.html#gae7400b9936841b02bf73f866568303b5">UNIT_MONTH</a>:</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;            retval = tm.<a class="code" href="structb_u_t_c___date_time__t.html#a3e00faf7fbf9805e9ec4d2edd6339050">month</a> - 1;</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;            <span class="keywordflow">break</span>;</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;        <span class="keywordflow">case</span> <a class="code" href="group___s_d_a___exported___defines.html#ga0da03f97aca2c96380d00500a0d2887c">UNIT_YEAR</a>:</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;            retval = tm.<a class="code" href="structb_u_t_c___date_time__t.html#a57ca98d8f6d4baf0fe41c583c7dcb0d5">year</a>;</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;            <span class="keywordflow">break</span>;</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;        <span class="keywordflow">default</span>:</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;            <span class="keywordflow">break</span>;</div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;    }</div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;    <span class="keywordflow">return</span> retval;</div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;}</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;</div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;</div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;</div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;<span class="keyword">static</span> <span class="keywordtype">int</span> _bSDA_CalOffset(<a class="code" href="structb_s_d_a___info__t.html">bSDA_Info_t</a> *pinfo, uint32_t utc, uint32_t *poffset)</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;{</div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;    uint32_t tmp[<a class="code" href="group___s_d_a___exported___defines.html#gaafb734a19a4b8eb8798af220955907ce">UNIT_NUMBER</a>];</div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;    <span class="keywordtype">int</span> retval;</div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;    int8_t unit;</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;    </div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;    unit = pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#a337a375940bfd3562a3864408833c9cb">st</a>.<a class="code" href="structb_s_d_a___struct__t.html#a34afb089f99ed87b9395389e0c81613e">min_unit</a>;</div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;    tmp[unit] = pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#a337a375940bfd3562a3864408833c9cb">st</a>.<a class="code" href="structb_s_d_a___struct__t.html#ac9c8f5dcbc6336fc5342b08634213134">min_size</a>;</div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;    unit += 1;</div><div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;    tmp[unit] = pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#a58c3c2f1f7c4bc785b72be555b017bc4">un_number</a> * pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#a337a375940bfd3562a3864408833c9cb">st</a>.<a class="code" href="structb_s_d_a___struct__t.html#a164d7d7bc468d06c6c1a99ba17eb3346">ferase_size</a>;</div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;    <span class="keywordflow">while</span>(unit != pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#a337a375940bfd3562a3864408833c9cb">st</a>.<a class="code" href="structb_s_d_a___struct__t.html#afcbabe077990d48802adbe3ea84b1e70">total_unit</a>)</div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;    {</div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;        unit++;</div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;        tmp[unit] = uNumbers[unit - 1] * tmp[unit - 1];</div><div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;    }</div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;    </div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;    uint32_t offset = 0;</div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;    unit--;</div><div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;    <span class="keywordflow">while</span>(unit &gt;= pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#a337a375940bfd3562a3864408833c9cb">st</a>.<a class="code" href="structb_s_d_a___struct__t.html#a34afb089f99ed87b9395389e0c81613e">min_unit</a>)</div><div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;    {</div><div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;        retval = _bSDA_GetTimeValue(unit, utc);</div><div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;        <span class="keywordflow">if</span>(retval &lt; 0)</div><div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;        {</div><div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;            <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;        }</div><div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;        <span class="keywordflow">if</span>(unit == pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#a337a375940bfd3562a3864408833c9cb">st</a>.<a class="code" href="structb_s_d_a___struct__t.html#a34afb089f99ed87b9395389e0c81613e">min_unit</a>)</div><div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;        {</div><div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;            retval = retval / pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#a337a375940bfd3562a3864408833c9cb">st</a>.<a class="code" href="structb_s_d_a___struct__t.html#a80a94b0aa4a45d6d345a88b82c1826df">min_number</a>;</div><div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;        }</div><div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;        offset += (uint32_t)retval * tmp[unit]; </div><div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;        unit--;</div><div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;    }</div><div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;    *poffset = offset;</div><div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;    <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;}</div><div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;</div><div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;</div><div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;<span class="keyword">static</span> <span class="keywordtype">int</span> _bSDA_CalAddress(<a class="code" href="structb_s_d_a___info__t.html">bSDA_Info_t</a> *pinfo, uint32_t utc, uint32_t *paddr)</div><div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;{</div><div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;    uint32_t address;</div><div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;    uint32_t per_size = 0, offset = 0;</div><div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;    <span class="keywordtype">int</span> retval;</div><div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;    </div><div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;    address = pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#a80d68ca9cbeea24d62a23d9e35a67c22">data_address</a>;</div><div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;    <span class="keywordflow">if</span>(pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#a337a375940bfd3562a3864408833c9cb">st</a>.<a class="code" href="structb_s_d_a___struct__t.html#a702640e2145f0cc10b783f2f5f6d4de2">total_number</a> &gt; 1)</div><div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;    {</div><div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;        per_size = pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#acdfd526bb392e1ee59a3c6c545891b48">total_size</a> / pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#a337a375940bfd3562a3864408833c9cb">st</a>.<a class="code" href="structb_s_d_a___struct__t.html#a702640e2145f0cc10b783f2f5f6d4de2">total_number</a>;</div><div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;        retval = _bSDA_GetTimeValue(pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#a337a375940bfd3562a3864408833c9cb">st</a>.<a class="code" href="structb_s_d_a___struct__t.html#afcbabe077990d48802adbe3ea84b1e70">total_unit</a>, utc);</div><div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;        retval = retval % pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#a337a375940bfd3562a3864408833c9cb">st</a>.<a class="code" href="structb_s_d_a___struct__t.html#a702640e2145f0cc10b783f2f5f6d4de2">total_number</a>;</div><div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;        address += retval * per_size;</div><div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;    }    </div><div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;    </div><div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;    <span class="keywordflow">if</span>(pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#a337a375940bfd3562a3864408833c9cb">st</a>.<a class="code" href="structb_s_d_a___struct__t.html#afcbabe077990d48802adbe3ea84b1e70">total_unit</a> != pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#a337a375940bfd3562a3864408833c9cb">st</a>.<a class="code" href="structb_s_d_a___struct__t.html#a34afb089f99ed87b9395389e0c81613e">min_unit</a>)</div><div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;    {</div><div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;        <span class="keywordflow">if</span>(_bSDA_CalOffset(pinfo, utc, &amp;offset) &lt; 0)</div><div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;        {</div><div class="line"><a name="l00210"></a><span class="lineno">  210</span>&#160;            <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00211"></a><span class="lineno">  211</span>&#160;        }</div><div class="line"><a name="l00212"></a><span class="lineno">  212</span>&#160;        address += offset;</div><div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;    }</div><div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;    *paddr = address;</div><div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;    <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;}</div><div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;</div><div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;</div><div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;</div><div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group___s_d_a___exported___functions.html#gad4f83d4a30501a5c1a14cc38738a8227">bSDA_Regist</a>(<a class="code" href="structb_s_d_a___struct__t.html">bSDA_Struct_t</a> st, uint8_t dev_no)</div><div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;{</div><div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;    uint8_t unit = st.<a class="code" href="structb_s_d_a___struct__t.html#a34afb089f99ed87b9395389e0c81613e">min_unit</a>;</div><div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;    <span class="keywordflow">if</span>(bSDA_InfoIndex &gt;= <a class="code" href="b__config_8h.html#a1c60d01d34d0e5f6d11ab663dfcb7801">_SAVE_DATA_A_I_NUMBER</a> || (!<a class="code" href="group___s_d_a___exported___macros.html#ga3e1042c585d3b9145f6b7e4c59797e5a">IS_UNIT_VALID</a>(st.<a class="code" href="structb_s_d_a___struct__t.html#a34afb089f99ed87b9395389e0c81613e">min_unit</a>)) || (!<a class="code" href="group___s_d_a___exported___macros.html#ga3e1042c585d3b9145f6b7e4c59797e5a">IS_UNIT_VALID</a>(st.<a class="code" href="structb_s_d_a___struct__t.html#afcbabe077990d48802adbe3ea84b1e70">total_unit</a>)))</div><div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;    {</div><div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;        <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;    }</div><div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;    </div><div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;    <span class="keywordflow">if</span>(st.<a class="code" href="structb_s_d_a___struct__t.html#ac9c8f5dcbc6336fc5342b08634213134">min_size</a> &gt; st.<a class="code" href="structb_s_d_a___struct__t.html#a164d7d7bc468d06c6c1a99ba17eb3346">ferase_size</a>)</div><div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;    {</div><div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;        <span class="keywordflow">return</span> -2;</div><div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;    }</div><div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;</div><div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;    <a class="code" href="structb_s_d_a___info__t.html">bSDA_Info_t</a> *pinfo = &amp;bSDA_InfoTable[bSDA_InfoIndex];</div><div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;    </div><div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;    pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#aead7729865941bd802dfe73093bc4f0a">n_per_eu</a> = st.<a class="code" href="structb_s_d_a___struct__t.html#a164d7d7bc468d06c6c1a99ba17eb3346">ferase_size</a> / st.<a class="code" href="structb_s_d_a___struct__t.html#ac9c8f5dcbc6336fc5342b08634213134">min_size</a>;</div><div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;    pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#a58c3c2f1f7c4bc785b72be555b017bc4">un_number</a> = ((uNumbers[st.<a class="code" href="structb_s_d_a___struct__t.html#a34afb089f99ed87b9395389e0c81613e">min_unit</a>] / st.<a class="code" href="structb_s_d_a___struct__t.html#a80a94b0aa4a45d6d345a88b82c1826df">min_number</a>) + (pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#aead7729865941bd802dfe73093bc4f0a">n_per_eu</a> - 1)) / pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#aead7729865941bd802dfe73093bc4f0a">n_per_eu</a>;</div><div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;    </div><div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;    <span class="keywordflow">if</span>(st.<a class="code" href="structb_s_d_a___struct__t.html#afcbabe077990d48802adbe3ea84b1e70">total_unit</a> == st.<a class="code" href="structb_s_d_a___struct__t.html#a34afb089f99ed87b9395389e0c81613e">min_unit</a>)</div><div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;    {</div><div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;        pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#acdfd526bb392e1ee59a3c6c545891b48">total_size</a> = st.<a class="code" href="structb_s_d_a___struct__t.html#a702640e2145f0cc10b783f2f5f6d4de2">total_number</a> * st.<a class="code" href="structb_s_d_a___struct__t.html#a164d7d7bc468d06c6c1a99ba17eb3346">ferase_size</a>;</div><div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;    }</div><div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;    <span class="keywordflow">else</span> <span class="keywordflow">if</span>(st.<a class="code" href="structb_s_d_a___struct__t.html#afcbabe077990d48802adbe3ea84b1e70">total_unit</a> &gt; st.<a class="code" href="structb_s_d_a___struct__t.html#a34afb089f99ed87b9395389e0c81613e">min_unit</a>)</div><div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;    {</div><div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;        unit = st.<a class="code" href="structb_s_d_a___struct__t.html#a34afb089f99ed87b9395389e0c81613e">min_unit</a>;</div><div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;        pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#acdfd526bb392e1ee59a3c6c545891b48">total_size</a> = pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#a58c3c2f1f7c4bc785b72be555b017bc4">un_number</a> * st.<a class="code" href="structb_s_d_a___struct__t.html#a164d7d7bc468d06c6c1a99ba17eb3346">ferase_size</a>;</div><div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;        unit++;</div><div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;        <span class="keywordflow">while</span>(unit != st.<a class="code" href="structb_s_d_a___struct__t.html#afcbabe077990d48802adbe3ea84b1e70">total_unit</a>)</div><div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;        {</div><div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;            pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#acdfd526bb392e1ee59a3c6c545891b48">total_size</a> = pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#acdfd526bb392e1ee59a3c6c545891b48">total_size</a> * uNumbers[unit];</div><div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;            unit++;</div><div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;        }</div><div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;        pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#acdfd526bb392e1ee59a3c6c545891b48">total_size</a> = pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#acdfd526bb392e1ee59a3c6c545891b48">total_size</a> * st.<a class="code" href="structb_s_d_a___struct__t.html#a702640e2145f0cc10b783f2f5f6d4de2">total_number</a>;</div><div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;    }</div><div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;    <span class="keywordflow">else</span></div><div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;    {</div><div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;        <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;    }</div><div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;    pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#acdfd526bb392e1ee59a3c6c545891b48">total_size</a> += st.<a class="code" href="structb_s_d_a___struct__t.html#a164d7d7bc468d06c6c1a99ba17eb3346">ferase_size</a>;</div><div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;    <span class="keywordflow">if</span>(pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#acdfd526bb392e1ee59a3c6c545891b48">total_size</a> &gt; st.<a class="code" href="structb_s_d_a___struct__t.html#aa5092484dbc5fc29a229feee0eae1246">fsize</a>)</div><div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;    {</div><div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;        printf(<span class="stringliteral">&quot;please rearrange total size %d--&gt;%d\r\n&quot;</span>, st.<a class="code" href="structb_s_d_a___struct__t.html#aa5092484dbc5fc29a229feee0eae1246">fsize</a>, pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#acdfd526bb392e1ee59a3c6c545891b48">total_size</a>);</div><div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;        <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00280"></a><span class="lineno">  280</span>&#160;    }</div><div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;    pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#a904bfc784ec019bfdea0236c862aea9b">base_address</a> = st.<a class="code" href="structb_s_d_a___struct__t.html#a6c38e52234d4b303b56e98deaef5ac37">fbase_address</a>;</div><div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;    pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#a80d68ca9cbeea24d62a23d9e35a67c22">data_address</a> = st.<a class="code" href="structb_s_d_a___struct__t.html#a6c38e52234d4b303b56e98deaef5ac37">fbase_address</a> + st.<a class="code" href="structb_s_d_a___struct__t.html#a164d7d7bc468d06c6c1a99ba17eb3346">ferase_size</a>;</div><div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;    pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#a858e2685fb0034acadcd8d48cf6f02b2">dev_no</a> = dev_no;</div><div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;    pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#ada1f0203dd8dbfc9e79623ecc19baab7">e_flag</a> = 1;</div><div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;    memcpy(&amp;(pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#a337a375940bfd3562a3864408833c9cb">st</a>), &amp;st, <span class="keyword">sizeof</span>(<a class="code" href="structb_s_d_a___struct__t.html">bSDA_Struct_t</a>));</div><div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;    <a class="code" href="b__config_8h.html#afc78b16ad8aebf30b9cabfc278cfb32a">b_log</a>(<span class="stringliteral">&quot;peu:%d\tunn:%d\tba:%d\tts:%d\r\n&quot;</span>, pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#aead7729865941bd802dfe73093bc4f0a">n_per_eu</a>, pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#a58c3c2f1f7c4bc785b72be555b017bc4">un_number</a>, pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#a904bfc784ec019bfdea0236c862aea9b">base_address</a>, pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#acdfd526bb392e1ee59a3c6c545891b48">total_size</a>);</div><div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;    bSDA_InfoIndex += 1;</div><div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;    <span class="keywordflow">return</span> (bSDA_InfoIndex - 1);</div><div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;}</div><div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;</div><div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;</div><div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group___s_d_a___exported___functions.html#ga4daee81bc3c74a158d9c1046ca4a903d">bSDA_Write</a>(<span class="keywordtype">int</span> no, uint32_t utc, uint8_t *pbuf)</div><div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;{</div><div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;    uint32_t address = 0;</div><div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;    <span class="keywordtype">int</span> retval = -1;</div><div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;    </div><div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;    <span class="keywordflow">if</span>(pbuf == <a class="code" href="b__config_8h.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a> || no &gt;= bSDA_InfoIndex || no &lt; 0)</div><div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;    {</div><div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;        <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;    }</div><div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;    </div><div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;    <a class="code" href="structb_s_d_a___info__t.html">bSDA_Info_t</a> *pinfo = &amp;bSDA_InfoTable[no];</div><div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;    </div><div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;    <span class="keywordflow">if</span>(_bSDA_CheckInfo(pinfo) &lt; 0)</div><div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;    {</div><div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;        <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;    }</div><div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;  </div><div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;    <span class="keywordflow">if</span>(_bSDA_CalAddress(pinfo, utc, &amp;address) &lt; 0)</div><div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;    {</div><div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;        <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;    }</div><div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;</div><div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160;    <span class="keywordtype">int</span> d_fd = -1;</div><div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;    d_fd = <a class="code" href="group___c_o_r_e___exported___functions.html#ga249e47165f733672eae3653fcca87829">bOpen</a>(pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#a858e2685fb0034acadcd8d48cf6f02b2">dev_no</a>, <a class="code" href="group___c_o_r_e___exported___defines.html#ga0198147efa03609c64760662bd8ea00c">BCORE_FLAG_RW</a>);</div><div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;    <span class="keywordflow">if</span>(d_fd &lt; 0)</div><div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;    {</div><div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160;        <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;    }</div><div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;    </div><div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160;    <a class="code" href="structb_c_m_d___struct__t.html">bCMD_Struct_t</a> cmd_s;</div><div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;    cmd_s.<a class="code" href="structb_c_m_d___struct__t.html#a1d127017fb298b889f4ba24752d08b8e">type</a> = <a class="code" href="group___d_e_v_i_c_e___ctl_c_m_d___defines.html#ga96464751587c9b064a2c7cee9881402a">bCMD_ERASE</a>;</div><div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;    cmd_s.<a class="code" href="structb_c_m_d___struct__t.html#a7ce465aa898864961d9fcfd902cc61fc">param</a>.<a class="code" href="structb_c_m_d___struct__t.html#a98946e69cf1ec51d231b3cc2a2b450e1">erase</a>.<a class="code" href="structb_c_m_d___erase__t.html#ab439e3a90339e2e8ca8f82d4557a34e5">addr</a> = address;</div><div class="line"><a name="l00333"></a><span class="lineno">  333</span>&#160;    cmd_s.<a class="code" href="structb_c_m_d___struct__t.html#a7ce465aa898864961d9fcfd902cc61fc">param</a>.<a class="code" href="structb_c_m_d___struct__t.html#a98946e69cf1ec51d231b3cc2a2b450e1">erase</a>.<a class="code" href="structb_c_m_d___erase__t.html#a7beea8f6745c478347f244cadef771c2">num</a> = 1;</div><div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160;    </div><div class="line"><a name="l00335"></a><span class="lineno">  335</span>&#160;    <a class="code" href="group___c_o_r_e___exported___functions.html#gad49412624e7b58f0b90ff43e60823eb1">bLseek</a>(d_fd, address);</div><div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;    <span class="keywordflow">if</span>(pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#a337a375940bfd3562a3864408833c9cb">st</a>.<a class="code" href="structb_s_d_a___struct__t.html#afcbabe077990d48802adbe3ea84b1e70">total_unit</a> == pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#a337a375940bfd3562a3864408833c9cb">st</a>.<a class="code" href="structb_s_d_a___struct__t.html#a34afb089f99ed87b9395389e0c81613e">min_unit</a>)</div><div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;    {</div><div class="line"><a name="l00338"></a><span class="lineno">  338</span>&#160;        <a class="code" href="group___c_o_r_e___exported___functions.html#gaf0a95eb51c436b56de56cdc63f5dab7c">bCtl</a>(d_fd, <a class="code" href="group___d_e_v_i_c_e___ctl_c_m_d___defines.html#ga96464751587c9b064a2c7cee9881402a">bCMD_ERASE</a>, &amp;cmd_s);</div><div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;        retval = <a class="code" href="group___c_o_r_e___exported___functions.html#ga078b200cdc68be6d562cc1ad323d9381">bWrite</a>(d_fd, pbuf, pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#a337a375940bfd3562a3864408833c9cb">st</a>.<a class="code" href="structb_s_d_a___struct__t.html#ac9c8f5dcbc6336fc5342b08634213134">min_size</a>);</div><div class="line"><a name="l00340"></a><span class="lineno">  340</span>&#160;    }</div><div class="line"><a name="l00341"></a><span class="lineno">  341</span>&#160;    <span class="keywordflow">else</span> </div><div class="line"><a name="l00342"></a><span class="lineno">  342</span>&#160;    {</div><div class="line"><a name="l00343"></a><span class="lineno">  343</span>&#160;        <span class="keywordflow">if</span>((address % (pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#a337a375940bfd3562a3864408833c9cb">st</a>.<a class="code" href="structb_s_d_a___struct__t.html#a164d7d7bc468d06c6c1a99ba17eb3346">ferase_size</a>) == 0) || ((address + pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#a337a375940bfd3562a3864408833c9cb">st</a>.<a class="code" href="structb_s_d_a___struct__t.html#ac9c8f5dcbc6336fc5342b08634213134">min_size</a>) / pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#a337a375940bfd3562a3864408833c9cb">st</a>.<a class="code" href="structb_s_d_a___struct__t.html#a164d7d7bc468d06c6c1a99ba17eb3346">ferase_size</a>) != (address / pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#a337a375940bfd3562a3864408833c9cb">st</a>.<a class="code" href="structb_s_d_a___struct__t.html#a164d7d7bc468d06c6c1a99ba17eb3346">ferase_size</a>) </div><div class="line"><a name="l00344"></a><span class="lineno">  344</span>&#160;            || pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#ada1f0203dd8dbfc9e79623ecc19baab7">e_flag</a> == 1)</div><div class="line"><a name="l00345"></a><span class="lineno">  345</span>&#160;        {</div><div class="line"><a name="l00346"></a><span class="lineno">  346</span>&#160;            <a class="code" href="group___c_o_r_e___exported___functions.html#gaf0a95eb51c436b56de56cdc63f5dab7c">bCtl</a>(d_fd, <a class="code" href="group___d_e_v_i_c_e___ctl_c_m_d___defines.html#ga96464751587c9b064a2c7cee9881402a">bCMD_ERASE</a>, &amp;cmd_s);</div><div class="line"><a name="l00347"></a><span class="lineno">  347</span>&#160;            pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#ada1f0203dd8dbfc9e79623ecc19baab7">e_flag</a> = 0;</div><div class="line"><a name="l00348"></a><span class="lineno">  348</span>&#160;        }</div><div class="line"><a name="l00349"></a><span class="lineno">  349</span>&#160;        retval = <a class="code" href="group___c_o_r_e___exported___functions.html#ga078b200cdc68be6d562cc1ad323d9381">bWrite</a>(d_fd, pbuf, pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#a337a375940bfd3562a3864408833c9cb">st</a>.<a class="code" href="structb_s_d_a___struct__t.html#ac9c8f5dcbc6336fc5342b08634213134">min_size</a>);</div><div class="line"><a name="l00350"></a><span class="lineno">  350</span>&#160;    }</div><div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160;    <a class="code" href="group___c_o_r_e___exported___functions.html#ga2d5143bd4493f8069401bb433939de4f">bClose</a>(d_fd);</div><div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160;    <span class="keywordflow">return</span> retval;</div><div class="line"><a name="l00353"></a><span class="lineno">  353</span>&#160;}</div><div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160;</div><div class="line"><a name="l00355"></a><span class="lineno">  355</span>&#160;</div><div class="line"><a name="l00365"></a><span class="lineno">  365</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group___s_d_a___exported___functions.html#ga989e491d90fefc4bd0508b0e2e11890c">bSDA_Read</a>(<span class="keywordtype">int</span> no, uint32_t utc, uint8_t *pbuf)</div><div class="line"><a name="l00366"></a><span class="lineno">  366</span>&#160;{</div><div class="line"><a name="l00367"></a><span class="lineno">  367</span>&#160;    uint32_t address = 0;</div><div class="line"><a name="l00368"></a><span class="lineno">  368</span>&#160;    <span class="keywordtype">int</span> retval = -1;</div><div class="line"><a name="l00369"></a><span class="lineno">  369</span>&#160;    </div><div class="line"><a name="l00370"></a><span class="lineno">  370</span>&#160;    <span class="keywordflow">if</span>(pbuf == <a class="code" href="b__config_8h.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a> || no &gt;= bSDA_InfoIndex || no &lt; 0)</div><div class="line"><a name="l00371"></a><span class="lineno">  371</span>&#160;    {</div><div class="line"><a name="l00372"></a><span class="lineno">  372</span>&#160;        <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00373"></a><span class="lineno">  373</span>&#160;    }</div><div class="line"><a name="l00374"></a><span class="lineno">  374</span>&#160;    </div><div class="line"><a name="l00375"></a><span class="lineno">  375</span>&#160;    <a class="code" href="structb_s_d_a___info__t.html">bSDA_Info_t</a> *pinfo = &amp;bSDA_InfoTable[no];</div><div class="line"><a name="l00376"></a><span class="lineno">  376</span>&#160;    <span class="keywordflow">if</span>(_bSDA_CheckInfo(pinfo) &lt; 0)</div><div class="line"><a name="l00377"></a><span class="lineno">  377</span>&#160;    {</div><div class="line"><a name="l00378"></a><span class="lineno">  378</span>&#160;        <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00379"></a><span class="lineno">  379</span>&#160;    }</div><div class="line"><a name="l00380"></a><span class="lineno">  380</span>&#160;    </div><div class="line"><a name="l00381"></a><span class="lineno">  381</span>&#160;    <span class="keywordflow">if</span>(_bSDA_CalAddress(pinfo, utc, &amp;address) &lt; 0)</div><div class="line"><a name="l00382"></a><span class="lineno">  382</span>&#160;    {</div><div class="line"><a name="l00383"></a><span class="lineno">  383</span>&#160;        <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00384"></a><span class="lineno">  384</span>&#160;    }</div><div class="line"><a name="l00385"></a><span class="lineno">  385</span>&#160;    </div><div class="line"><a name="l00386"></a><span class="lineno">  386</span>&#160;    <span class="keywordtype">int</span> d_fd = -1;</div><div class="line"><a name="l00387"></a><span class="lineno">  387</span>&#160;    d_fd = <a class="code" href="group___c_o_r_e___exported___functions.html#ga249e47165f733672eae3653fcca87829">bOpen</a>(pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#a858e2685fb0034acadcd8d48cf6f02b2">dev_no</a>, <a class="code" href="group___c_o_r_e___exported___defines.html#ga9632edfe3a6652c254922f0fc6e4315c">BCORE_FLAG_R</a>);</div><div class="line"><a name="l00388"></a><span class="lineno">  388</span>&#160;    <span class="keywordflow">if</span>(d_fd &lt; 0)</div><div class="line"><a name="l00389"></a><span class="lineno">  389</span>&#160;    {</div><div class="line"><a name="l00390"></a><span class="lineno">  390</span>&#160;        <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00391"></a><span class="lineno">  391</span>&#160;    }</div><div class="line"><a name="l00392"></a><span class="lineno">  392</span>&#160;    <a class="code" href="group___c_o_r_e___exported___functions.html#gad49412624e7b58f0b90ff43e60823eb1">bLseek</a>(d_fd, address);</div><div class="line"><a name="l00393"></a><span class="lineno">  393</span>&#160;    retval = <a class="code" href="group___c_o_r_e___exported___functions.html#ga19ddb6f8ca523b3b28b74ea6a1519e3b">bRead</a>(d_fd, pbuf, pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#a337a375940bfd3562a3864408833c9cb">st</a>.<a class="code" href="structb_s_d_a___struct__t.html#ac9c8f5dcbc6336fc5342b08634213134">min_size</a>);</div><div class="line"><a name="l00394"></a><span class="lineno">  394</span>&#160;    <a class="code" href="group___c_o_r_e___exported___functions.html#ga2d5143bd4493f8069401bb433939de4f">bClose</a>(d_fd);</div><div class="line"><a name="l00395"></a><span class="lineno">  395</span>&#160;    <span class="keywordflow">return</span> retval;</div><div class="line"><a name="l00396"></a><span class="lineno">  396</span>&#160;}</div><div class="line"><a name="l00397"></a><span class="lineno">  397</span>&#160;</div><div class="line"><a name="l00407"></a><span class="lineno">  407</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group___s_d_a___exported___functions.html#gafd3bff98026ad51c5a0735cd6cb99034">bSDA_TimeChanged</a>(<span class="keywordtype">int</span> no, uint32_t o_utc, uint32_t n_utc)</div><div class="line"><a name="l00408"></a><span class="lineno">  408</span>&#160;{</div><div class="line"><a name="l00409"></a><span class="lineno">  409</span>&#160;    uint32_t address_o, address_n;</div><div class="line"><a name="l00410"></a><span class="lineno">  410</span>&#160;    </div><div class="line"><a name="l00411"></a><span class="lineno">  411</span>&#160;    <span class="keywordflow">if</span>(no &gt;= bSDA_InfoIndex || no &lt; 0)</div><div class="line"><a name="l00412"></a><span class="lineno">  412</span>&#160;    {</div><div class="line"><a name="l00413"></a><span class="lineno">  413</span>&#160;        <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00414"></a><span class="lineno">  414</span>&#160;    }</div><div class="line"><a name="l00415"></a><span class="lineno">  415</span>&#160;    <a class="code" href="structb_s_d_a___info__t.html">bSDA_Info_t</a> *pinfo = &amp;bSDA_InfoTable[no];</div><div class="line"><a name="l00416"></a><span class="lineno">  416</span>&#160;    <span class="keywordflow">if</span>(_bSDA_CalAddress(pinfo, o_utc, &amp;address_o) &lt; 0)</div><div class="line"><a name="l00417"></a><span class="lineno">  417</span>&#160;    {</div><div class="line"><a name="l00418"></a><span class="lineno">  418</span>&#160;        <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00419"></a><span class="lineno">  419</span>&#160;    }</div><div class="line"><a name="l00420"></a><span class="lineno">  420</span>&#160;    </div><div class="line"><a name="l00421"></a><span class="lineno">  421</span>&#160;    <span class="keywordflow">if</span>(_bSDA_CalAddress(pinfo, n_utc, &amp;address_n) &lt; 0)</div><div class="line"><a name="l00422"></a><span class="lineno">  422</span>&#160;    {</div><div class="line"><a name="l00423"></a><span class="lineno">  423</span>&#160;        <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00424"></a><span class="lineno">  424</span>&#160;    }</div><div class="line"><a name="l00425"></a><span class="lineno">  425</span>&#160;    </div><div class="line"><a name="l00426"></a><span class="lineno">  426</span>&#160;    <span class="keywordflow">if</span>(address_o / pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#a337a375940bfd3562a3864408833c9cb">st</a>.<a class="code" href="structb_s_d_a___struct__t.html#a164d7d7bc468d06c6c1a99ba17eb3346">ferase_size</a> != address_n / pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#a337a375940bfd3562a3864408833c9cb">st</a>.<a class="code" href="structb_s_d_a___struct__t.html#a164d7d7bc468d06c6c1a99ba17eb3346">ferase_size</a>)</div><div class="line"><a name="l00427"></a><span class="lineno">  427</span>&#160;    {</div><div class="line"><a name="l00428"></a><span class="lineno">  428</span>&#160;        pinfo-&gt;<a class="code" href="structb_s_d_a___info__t.html#ada1f0203dd8dbfc9e79623ecc19baab7">e_flag</a> = 1;</div><div class="line"><a name="l00429"></a><span class="lineno">  429</span>&#160;    }</div><div class="line"><a name="l00430"></a><span class="lineno">  430</span>&#160;    <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l00431"></a><span class="lineno">  431</span>&#160;}</div><div class="line"><a name="l00432"></a><span class="lineno">  432</span>&#160;</div><div class="line"><a name="l00444"></a><span class="lineno">  444</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00445"></a><span class="lineno">  445</span>&#160;</div><div class="line"><a name="l00446"></a><span class="lineno">  446</span>&#160;<span class="comment">/************************ Copyright (c) 2019 Bean *****END OF FILE****/</span></div><div class="line"><a name="l00447"></a><span class="lineno">  447</span>&#160;</div><div class="ttc" id="b__config_8h_html_a1c60d01d34d0e5f6d11ab663dfcb7801"><div class="ttname"><a href="b__config_8h.html#a1c60d01d34d0e5f6d11ab663dfcb7801">_SAVE_DATA_A_I_NUMBER</a></div><div class="ttdeci">#define _SAVE_DATA_A_I_NUMBER</div><div class="ttdef"><b>Definition:</b> <a href="b__config_8h_source.html#l00115">b_config.h:115</a></div></div>
<div class="ttc" id="structb_s_d_a___struct__t_html_ac9c8f5dcbc6336fc5342b08634213134"><div class="ttname"><a href="structb_s_d_a___struct__t.html#ac9c8f5dcbc6336fc5342b08634213134">bSDA_Struct_t::min_size</a></div><div class="ttdeci">uint32_t min_size</div><div class="ttdef"><b>Definition:</b> <a href="b__sda_8h_source.html#l00061">b_sda.h:61</a></div></div>
<div class="ttc" id="group___c_o_r_e___exported___functions_html_gaf0a95eb51c436b56de56cdc63f5dab7c"><div class="ttname"><a href="group___c_o_r_e___exported___functions.html#gaf0a95eb51c436b56de56cdc63f5dab7c">bCtl</a></div><div class="ttdeci">int bCtl(int fd, uint8_t cmd, void *param)</div><div class="ttdef"><b>Definition:</b> <a href="b__core_8c_source.html#l00254">b_core.c:254</a></div></div>
<div class="ttc" id="structb_s_d_a___struct__t_html_a164d7d7bc468d06c6c1a99ba17eb3346"><div class="ttname"><a href="structb_s_d_a___struct__t.html#a164d7d7bc468d06c6c1a99ba17eb3346">bSDA_Struct_t::ferase_size</a></div><div class="ttdeci">uint32_t ferase_size</div><div class="ttdef"><b>Definition:</b> <a href="b__sda_8h_source.html#l00067">b_sda.h:67</a></div></div>
<div class="ttc" id="structb_s_d_a___struct__t_html_aa5092484dbc5fc29a229feee0eae1246"><div class="ttname"><a href="structb_s_d_a___struct__t.html#aa5092484dbc5fc29a229feee0eae1246">bSDA_Struct_t::fsize</a></div><div class="ttdeci">uint32_t fsize</div><div class="ttdef"><b>Definition:</b> <a href="b__sda_8h_source.html#l00066">b_sda.h:66</a></div></div>
<div class="ttc" id="structb_s_d_a___struct__t_html_afcbabe077990d48802adbe3ea84b1e70"><div class="ttname"><a href="structb_s_d_a___struct__t.html#afcbabe077990d48802adbe3ea84b1e70">bSDA_Struct_t::total_unit</a></div><div class="ttdeci">uint8_t total_unit</div><div class="ttdef"><b>Definition:</b> <a href="b__sda_8h_source.html#l00062">b_sda.h:62</a></div></div>
<div class="ttc" id="group___s_d_a___exported___defines_html_gaafb734a19a4b8eb8798af220955907ce"><div class="ttname"><a href="group___s_d_a___exported___defines.html#gaafb734a19a4b8eb8798af220955907ce">UNIT_NUMBER</a></div><div class="ttdeci">#define UNIT_NUMBER</div><div class="ttdef"><b>Definition:</b> <a href="b__sda_8h_source.html#l00106">b_sda.h:106</a></div></div>
<div class="ttc" id="group___s_d_a___exported___functions_html_gad4f83d4a30501a5c1a14cc38738a8227"><div class="ttname"><a href="group___s_d_a___exported___functions.html#gad4f83d4a30501a5c1a14cc38738a8227">bSDA_Regist</a></div><div class="ttdeci">int bSDA_Regist(bSDA_Struct_t, uint8_t dev_no)</div></div>
<div class="ttc" id="structb_s_d_a___info__t_html_a58c3c2f1f7c4bc785b72be555b017bc4"><div class="ttname"><a href="structb_s_d_a___info__t.html#a58c3c2f1f7c4bc785b72be555b017bc4">bSDA_Info_t::un_number</a></div><div class="ttdeci">uint16_t un_number</div><div class="ttdef"><b>Definition:</b> <a href="b__sda_8h_source.html#l00075">b_sda.h:75</a></div></div>
<div class="ttc" id="structb_u_t_c___date_time__t_html_a57ca98d8f6d4baf0fe41c583c7dcb0d5"><div class="ttname"><a href="structb_u_t_c___date_time__t.html#a57ca98d8f6d4baf0fe41c583c7dcb0d5">bUTC_DateTime_t::year</a></div><div class="ttdeci">uint16_t year</div><div class="ttdef"><b>Definition:</b> <a href="b__utc_8h_source.html#l00057">b_utc.h:57</a></div></div>
<div class="ttc" id="structb_u_t_c___date_time__t_html_a72369a1087b2aeffe374bb054cb97c12"><div class="ttname"><a href="structb_u_t_c___date_time__t.html#a72369a1087b2aeffe374bb054cb97c12">bUTC_DateTime_t::day</a></div><div class="ttdeci">uint8_t day</div><div class="ttdef"><b>Definition:</b> <a href="b__utc_8h_source.html#l00059">b_utc.h:59</a></div></div>
<div class="ttc" id="b__config_8h_html_a070d2ce7b6bb7e5c05602aa8c308d0c4"><div class="ttname"><a href="b__config_8h.html#a070d2ce7b6bb7e5c05602aa8c308d0c4">NULL</a></div><div class="ttdeci">#define NULL</div><div class="ttdef"><b>Definition:</b> <a href="b__config_8h_source.html#l00042">b_config.h:42</a></div></div>
<div class="ttc" id="group___c_o_r_e___exported___defines_html_ga0198147efa03609c64760662bd8ea00c"><div class="ttname"><a href="group___c_o_r_e___exported___defines.html#ga0198147efa03609c64760662bd8ea00c">BCORE_FLAG_RW</a></div><div class="ttdeci">#define BCORE_FLAG_RW</div><div class="ttdef"><b>Definition:</b> <a href="b__core_8h_source.html#l00082">b_core.h:82</a></div></div>
<div class="ttc" id="group___s_d_a___exported___macros_html_ga3e1042c585d3b9145f6b7e4c59797e5a"><div class="ttname"><a href="group___s_d_a___exported___macros.html#ga3e1042c585d3b9145f6b7e4c59797e5a">IS_UNIT_VALID</a></div><div class="ttdeci">#define IS_UNIT_VALID(n)</div><div class="ttdef"><b>Definition:</b> <a href="b__sda_8h_source.html#l00120">b_sda.h:120</a></div></div>
<div class="ttc" id="structb_s_d_a___info__t_html_a80d68ca9cbeea24d62a23d9e35a67c22"><div class="ttname"><a href="structb_s_d_a___info__t.html#a80d68ca9cbeea24d62a23d9e35a67c22">bSDA_Info_t::data_address</a></div><div class="ttdeci">uint32_t data_address</div><div class="ttdef"><b>Definition:</b> <a href="b__sda_8h_source.html#l00078">b_sda.h:78</a></div></div>
<div class="ttc" id="group___s_d_a___exported___defines_html_ga34ef9d077cc547e8924ee1757f6af738"><div class="ttname"><a href="group___s_d_a___exported___defines.html#ga34ef9d077cc547e8924ee1757f6af738">UNIT_DAY</a></div><div class="ttdeci">#define UNIT_DAY</div><div class="ttdef"><b>Definition:</b> <a href="b__sda_8h_source.html#l00103">b_sda.h:103</a></div></div>
<div class="ttc" id="b__sda_8h_html"><div class="ttname"><a href="b__sda_8h.html">b_sda.h</a></div></div>
<div class="ttc" id="group___s_d_a___exported___defines_html_gae7400b9936841b02bf73f866568303b5"><div class="ttname"><a href="group___s_d_a___exported___defines.html#gae7400b9936841b02bf73f866568303b5">UNIT_MONTH</a></div><div class="ttdeci">#define UNIT_MONTH</div><div class="ttdef"><b>Definition:</b> <a href="b__sda_8h_source.html#l00104">b_sda.h:104</a></div></div>
<div class="ttc" id="group___c_o_r_e___exported___functions_html_ga078b200cdc68be6d562cc1ad323d9381"><div class="ttname"><a href="group___c_o_r_e___exported___functions.html#ga078b200cdc68be6d562cc1ad323d9381">bWrite</a></div><div class="ttdeci">int bWrite(int fd, uint8_t *pdata, uint16_t len)</div><div class="ttdef"><b>Definition:</b> <a href="b__core_8c_source.html#l00218">b_core.c:218</a></div></div>
<div class="ttc" id="group___c_o_r_e___exported___functions_html_ga249e47165f733672eae3653fcca87829"><div class="ttname"><a href="group___c_o_r_e___exported___functions.html#ga249e47165f733672eae3653fcca87829">bOpen</a></div><div class="ttdeci">int bOpen(uint8_t dev_no, uint8_t flag)</div><div class="ttdoc">Open a device. </div><div class="ttdef"><b>Definition:</b> <a href="b__core_8c_source.html#l00175">b_core.c:175</a></div></div>
<div class="ttc" id="group___s_d_a___exported___defines_html_ga05055f3cee948d8763312327597b6213"><div class="ttname"><a href="group___s_d_a___exported___defines.html#ga05055f3cee948d8763312327597b6213">UNIT_SECOND</a></div><div class="ttdeci">#define UNIT_SECOND</div><div class="ttdef"><b>Definition:</b> <a href="b__sda_8h_source.html#l00100">b_sda.h:100</a></div></div>
<div class="ttc" id="structb_s_d_a___struct__t_html_a80a94b0aa4a45d6d345a88b82c1826df"><div class="ttname"><a href="structb_s_d_a___struct__t.html#a80a94b0aa4a45d6d345a88b82c1826df">bSDA_Struct_t::min_number</a></div><div class="ttdeci">uint8_t min_number</div><div class="ttdef"><b>Definition:</b> <a href="b__sda_8h_source.html#l00060">b_sda.h:60</a></div></div>
<div class="ttc" id="structb_s_d_a___info__t_html_aead7729865941bd802dfe73093bc4f0a"><div class="ttname"><a href="structb_s_d_a___info__t.html#aead7729865941bd802dfe73093bc4f0a">bSDA_Info_t::n_per_eu</a></div><div class="ttdeci">uint16_t n_per_eu</div><div class="ttdef"><b>Definition:</b> <a href="b__sda_8h_source.html#l00074">b_sda.h:74</a></div></div>
<div class="ttc" id="structb_u_t_c___date_time__t_html_a8ff981ec55c945940f4a0da7d8709b3c"><div class="ttname"><a href="structb_u_t_c___date_time__t.html#a8ff981ec55c945940f4a0da7d8709b3c">bUTC_DateTime_t::minute</a></div><div class="ttdeci">uint8_t minute</div><div class="ttdef"><b>Definition:</b> <a href="b__utc_8h_source.html#l00062">b_utc.h:62</a></div></div>
<div class="ttc" id="structb_s_d_a___struct__t_html_a702640e2145f0cc10b783f2f5f6d4de2"><div class="ttname"><a href="structb_s_d_a___struct__t.html#a702640e2145f0cc10b783f2f5f6d4de2">bSDA_Struct_t::total_number</a></div><div class="ttdeci">uint8_t total_number</div><div class="ttdef"><b>Definition:</b> <a href="b__sda_8h_source.html#l00063">b_sda.h:63</a></div></div>
<div class="ttc" id="b__config_8h_html_afc78b16ad8aebf30b9cabfc278cfb32a"><div class="ttname"><a href="b__config_8h.html#afc78b16ad8aebf30b9cabfc278cfb32a">b_log</a></div><div class="ttdeci">#define b_log(...)</div><div class="ttdef"><b>Definition:</b> <a href="b__config_8h_source.html#l00232">b_config.h:232</a></div></div>
<div class="ttc" id="structb_u_t_c___date_time__t_html_a3e00faf7fbf9805e9ec4d2edd6339050"><div class="ttname"><a href="structb_u_t_c___date_time__t.html#a3e00faf7fbf9805e9ec4d2edd6339050">bUTC_DateTime_t::month</a></div><div class="ttdeci">uint8_t month</div><div class="ttdef"><b>Definition:</b> <a href="b__utc_8h_source.html#l00058">b_utc.h:58</a></div></div>
<div class="ttc" id="structb_s_d_a___info__t_html_a337a375940bfd3562a3864408833c9cb"><div class="ttname"><a href="structb_s_d_a___info__t.html#a337a375940bfd3562a3864408833c9cb">bSDA_Info_t::st</a></div><div class="ttdeci">bSDA_Struct_t st</div><div class="ttdef"><b>Definition:</b> <a href="b__sda_8h_source.html#l00079">b_sda.h:79</a></div></div>
<div class="ttc" id="structb_u_t_c___date_time__t_html_ae5af4ff48939d13d480f87e56a9385d6"><div class="ttname"><a href="structb_u_t_c___date_time__t.html#ae5af4ff48939d13d480f87e56a9385d6">bUTC_DateTime_t::hour</a></div><div class="ttdeci">uint8_t hour</div><div class="ttdef"><b>Definition:</b> <a href="b__utc_8h_source.html#l00061">b_utc.h:61</a></div></div>
<div class="ttc" id="group___s_d_a___exported___functions_html_ga4daee81bc3c74a158d9c1046ca4a903d"><div class="ttname"><a href="group___s_d_a___exported___functions.html#ga4daee81bc3c74a158d9c1046ca4a903d">bSDA_Write</a></div><div class="ttdeci">int bSDA_Write(int, uint32_t utc, uint8_t *pbuf)</div></div>
<div class="ttc" id="group___s_d_a___exported___functions_html_ga989e491d90fefc4bd0508b0e2e11890c"><div class="ttname"><a href="group___s_d_a___exported___functions.html#ga989e491d90fefc4bd0508b0e2e11890c">bSDA_Read</a></div><div class="ttdeci">int bSDA_Read(int, uint32_t utc, uint8_t *pbuf)</div></div>
<div class="ttc" id="structb_s_d_a___info__t_html_acdfd526bb392e1ee59a3c6c545891b48"><div class="ttname"><a href="structb_s_d_a___info__t.html#acdfd526bb392e1ee59a3c6c545891b48">bSDA_Info_t::total_size</a></div><div class="ttdeci">uint32_t total_size</div><div class="ttdef"><b>Definition:</b> <a href="b__sda_8h_source.html#l00076">b_sda.h:76</a></div></div>
<div class="ttc" id="structb_s_d_a___info__t_html_a904bfc784ec019bfdea0236c862aea9b"><div class="ttname"><a href="structb_s_d_a___info__t.html#a904bfc784ec019bfdea0236c862aea9b">bSDA_Info_t::base_address</a></div><div class="ttdeci">uint32_t base_address</div><div class="ttdef"><b>Definition:</b> <a href="b__sda_8h_source.html#l00077">b_sda.h:77</a></div></div>
<div class="ttc" id="structb_u_t_c___date_time__t_html_a8459fc4e94de7eefc74991e41779c8fc"><div class="ttname"><a href="structb_u_t_c___date_time__t.html#a8459fc4e94de7eefc74991e41779c8fc">bUTC_DateTime_t::second</a></div><div class="ttdeci">uint8_t second</div><div class="ttdef"><b>Definition:</b> <a href="b__utc_8h_source.html#l00063">b_utc.h:63</a></div></div>
<div class="ttc" id="group___u_t_c___exported___functions_html_ga51d84ed7d31f7df2d06f75ad8b296dd9"><div class="ttname"><a href="group___u_t_c___exported___functions.html#ga51d84ed7d31f7df2d06f75ad8b296dd9">bUTC2Struct</a></div><div class="ttdeci">void bUTC2Struct(bUTC_DateTime_t *tm, bUTC_t utc)</div></div>
<div class="ttc" id="structb_s_d_a___struct__t_html_a6c38e52234d4b303b56e98deaef5ac37"><div class="ttname"><a href="structb_s_d_a___struct__t.html#a6c38e52234d4b303b56e98deaef5ac37">bSDA_Struct_t::fbase_address</a></div><div class="ttdeci">uint32_t fbase_address</div><div class="ttdef"><b>Definition:</b> <a href="b__sda_8h_source.html#l00065">b_sda.h:65</a></div></div>
<div class="ttc" id="b__device_8h_html"><div class="ttname"><a href="b__device_8h.html">b_device.h</a></div></div>
<div class="ttc" id="b__utc_8h_html"><div class="ttname"><a href="b__utc_8h.html">b_utc.h</a></div></div>
<div class="ttc" id="structb_s_d_a___info__t_html"><div class="ttname"><a href="structb_s_d_a___info__t.html">bSDA_Info_t</a></div><div class="ttdef"><b>Definition:</b> <a href="b__sda_8h_source.html#l00071">b_sda.h:71</a></div></div>
<div class="ttc" id="b__core_8h_html"><div class="ttname"><a href="b__core_8h.html">b_core.h</a></div></div>
<div class="ttc" id="group___s_d_a___exported___defines_html_ga1b18e73a9b9253beff7c7b7a5460748a"><div class="ttname"><a href="group___s_d_a___exported___defines.html#ga1b18e73a9b9253beff7c7b7a5460748a">UNIT_MINUTE</a></div><div class="ttdeci">#define UNIT_MINUTE</div><div class="ttdef"><b>Definition:</b> <a href="b__sda_8h_source.html#l00101">b_sda.h:101</a></div></div>
<div class="ttc" id="structb_c_m_d___struct__t_html"><div class="ttname"><a href="structb_c_m_d___struct__t.html">bCMD_Struct_t</a></div><div class="ttdef"><b>Definition:</b> <a href="b__device_8h_source.html#l00062">b_device.h:62</a></div></div>
<div class="ttc" id="structb_c_m_d___struct__t_html_a1d127017fb298b889f4ba24752d08b8e"><div class="ttname"><a href="structb_c_m_d___struct__t.html#a1d127017fb298b889f4ba24752d08b8e">bCMD_Struct_t::type</a></div><div class="ttdeci">uint8_t type</div><div class="ttdef"><b>Definition:</b> <a href="b__device_8h_source.html#l00064">b_device.h:64</a></div></div>
<div class="ttc" id="group___c_o_r_e___exported___functions_html_gad49412624e7b58f0b90ff43e60823eb1"><div class="ttname"><a href="group___c_o_r_e___exported___functions.html#gad49412624e7b58f0b90ff43e60823eb1">bLseek</a></div><div class="ttdeci">int bLseek(int fd, uint32_t off)</div><div class="ttdef"><b>Definition:</b> <a href="b__core_8c_source.html#l00239">b_core.c:239</a></div></div>
<div class="ttc" id="group___s_d_a___exported___functions_html_gafd3bff98026ad51c5a0735cd6cb99034"><div class="ttname"><a href="group___s_d_a___exported___functions.html#gafd3bff98026ad51c5a0735cd6cb99034">bSDA_TimeChanged</a></div><div class="ttdeci">int bSDA_TimeChanged(int, uint32_t o_utc, uint32_t n_utc)</div></div>
<div class="ttc" id="structb_c_m_d___erase__t_html_a7beea8f6745c478347f244cadef771c2"><div class="ttname"><a href="structb_c_m_d___erase__t.html#a7beea8f6745c478347f244cadef771c2">bCMD_Erase_t::num</a></div><div class="ttdeci">uint32_t num</div><div class="ttdef"><b>Definition:</b> <a href="b__device_8h_source.html#l00058">b_device.h:58</a></div></div>
<div class="ttc" id="group___s_d_a___exported___defines_html_gaddaea55490fd45135a79081c00a90540"><div class="ttname"><a href="group___s_d_a___exported___defines.html#gaddaea55490fd45135a79081c00a90540">UNIT_HOUR</a></div><div class="ttdeci">#define UNIT_HOUR</div><div class="ttdef"><b>Definition:</b> <a href="b__sda_8h_source.html#l00102">b_sda.h:102</a></div></div>
<div class="ttc" id="structb_c_m_d___struct__t_html_a7ce465aa898864961d9fcfd902cc61fc"><div class="ttname"><a href="structb_c_m_d___struct__t.html#a7ce465aa898864961d9fcfd902cc61fc">bCMD_Struct_t::param</a></div><div class="ttdeci">union bCMD_Struct_t::@0 param</div></div>
<div class="ttc" id="group___c_o_r_e___exported___functions_html_ga19ddb6f8ca523b3b28b74ea6a1519e3b"><div class="ttname"><a href="group___c_o_r_e___exported___functions.html#ga19ddb6f8ca523b3b28b74ea6a1519e3b">bRead</a></div><div class="ttdeci">int bRead(int fd, uint8_t *pdata, uint16_t len)</div><div class="ttdef"><b>Definition:</b> <a href="b__core_8c_source.html#l00196">b_core.c:196</a></div></div>
<div class="ttc" id="structb_u_t_c___date_time__t_html"><div class="ttname"><a href="structb_u_t_c___date_time__t.html">bUTC_DateTime_t</a></div><div class="ttdef"><b>Definition:</b> <a href="b__utc_8h_source.html#l00055">b_utc.h:55</a></div></div>
<div class="ttc" id="structb_s_d_a___struct__t_html"><div class="ttname"><a href="structb_s_d_a___struct__t.html">bSDA_Struct_t</a></div><div class="ttdef"><b>Definition:</b> <a href="b__sda_8h_source.html#l00057">b_sda.h:57</a></div></div>
<div class="ttc" id="group___s_d_a___exported___defines_html_ga0da03f97aca2c96380d00500a0d2887c"><div class="ttname"><a href="group___s_d_a___exported___defines.html#ga0da03f97aca2c96380d00500a0d2887c">UNIT_YEAR</a></div><div class="ttdeci">#define UNIT_YEAR</div><div class="ttdef"><b>Definition:</b> <a href="b__sda_8h_source.html#l00105">b_sda.h:105</a></div></div>
<div class="ttc" id="structb_s_d_a___struct__t_html_a34afb089f99ed87b9395389e0c81613e"><div class="ttname"><a href="structb_s_d_a___struct__t.html#a34afb089f99ed87b9395389e0c81613e">bSDA_Struct_t::min_unit</a></div><div class="ttdeci">uint8_t min_unit</div><div class="ttdef"><b>Definition:</b> <a href="b__sda_8h_source.html#l00059">b_sda.h:59</a></div></div>
<div class="ttc" id="structb_s_d_a___info__t_html_a858e2685fb0034acadcd8d48cf6f02b2"><div class="ttname"><a href="structb_s_d_a___info__t.html#a858e2685fb0034acadcd8d48cf6f02b2">bSDA_Info_t::dev_no</a></div><div class="ttdeci">uint8_t dev_no</div><div class="ttdef"><b>Definition:</b> <a href="b__sda_8h_source.html#l00080">b_sda.h:80</a></div></div>
<div class="ttc" id="structb_s_d_a___info__t_html_ada1f0203dd8dbfc9e79623ecc19baab7"><div class="ttname"><a href="structb_s_d_a___info__t.html#ada1f0203dd8dbfc9e79623ecc19baab7">bSDA_Info_t::e_flag</a></div><div class="ttdeci">uint8_t e_flag</div><div class="ttdef"><b>Definition:</b> <a href="b__sda_8h_source.html#l00073">b_sda.h:73</a></div></div>
<div class="ttc" id="group___d_e_v_i_c_e___ctl_c_m_d___defines_html_ga96464751587c9b064a2c7cee9881402a"><div class="ttname"><a href="group___d_e_v_i_c_e___ctl_c_m_d___defines.html#ga96464751587c9b064a2c7cee9881402a">bCMD_ERASE</a></div><div class="ttdeci">#define bCMD_ERASE</div><div class="ttdef"><b>Definition:</b> <a href="b__device_8h_source.html#l00115">b_device.h:115</a></div></div>
<div class="ttc" id="group___c_o_r_e___exported___functions_html_ga2d5143bd4493f8069401bb433939de4f"><div class="ttname"><a href="group___c_o_r_e___exported___functions.html#ga2d5143bd4493f8069401bb433939de4f">bClose</a></div><div class="ttdeci">int bClose(int fd)</div><div class="ttdef"><b>Definition:</b> <a href="b__core_8c_source.html#l00265">b_core.c:265</a></div></div>
<div class="ttc" id="structb_c_m_d___erase__t_html_ab439e3a90339e2e8ca8f82d4557a34e5"><div class="ttname"><a href="structb_c_m_d___erase__t.html#ab439e3a90339e2e8ca8f82d4557a34e5">bCMD_Erase_t::addr</a></div><div class="ttdeci">uint32_t addr</div><div class="ttdef"><b>Definition:</b> <a href="b__device_8h_source.html#l00057">b_device.h:57</a></div></div>
<div class="ttc" id="structb_c_m_d___struct__t_html_a98946e69cf1ec51d231b3cc2a2b450e1"><div class="ttname"><a href="structb_c_m_d___struct__t.html#a98946e69cf1ec51d231b3cc2a2b450e1">bCMD_Struct_t::erase</a></div><div class="ttdeci">bCMD_Erase_t erase</div><div class="ttdef"><b>Definition:</b> <a href="b__device_8h_source.html#l00067">b_device.h:67</a></div></div>
<div class="ttc" id="group___c_o_r_e___exported___defines_html_ga9632edfe3a6652c254922f0fc6e4315c"><div class="ttname"><a href="group___c_o_r_e___exported___defines.html#ga9632edfe3a6652c254922f0fc6e4315c">BCORE_FLAG_R</a></div><div class="ttdeci">#define BCORE_FLAG_R</div><div class="ttdef"><b>Definition:</b> <a href="b__core_8h_source.html#l00080">b_core.h:80</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.14
</small></address>
</body>
</html>
